#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Length.h>
#include <LengthUnit.h>
#include <iostream>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Length)
{
	TEST(should be able to compare mile with yard. 1 mile = 1760 yard)
	{
		ASSERT_TRUE(Length(1,MILE) == Length(1760,YARD));
	}

	TEST(should be able to compare yard with feet. 1 yard = 3 feet)
	{
		ASSERT_TRUE(Length(1,YARD) == Length(3,FEET));
	}

	TEST(should be able to compare mile with feet. 1 mile = 1760 * 3 feet)
	{
		ASSERT_TRUE(Length(1, MILE) == Length(1760 * 3, FEET));
	}

    TEST(should be able to fail if mile not equal to yard. 1 mile != 1000 yard)
    {
        ASSERT_TRUE(Length(1,MILE) != Length(1000,YARD));
    }

    TEST(should be able to fail if yard not equal to feet, 1 yard != 100 feet)
    {
        ASSERT_TRUE(Length(1,YARD) != Length(100,FEET));
    }

    TEST(should be able to add yard to feet, 1 yard + 2 feet = 5 feet)
    {
        ASSERT_TRUE(Length(1,YARD) + Length(2,FEET) == Length(5,FEET));
    }
};

FIXTURE(print)
{
    TEST(should be able to print 2 feet as "2 FEET ")
    {
       ASSERT_EQ("2 FEET ", Length(2, FEET).outputString());
    }

    TEST(should be able to print 5 feet as "1 YARD 2 FEET ")
    {
       ASSERT_EQ("1 YARD 2 FEET ", Length(5, FEET).outputString());
    }

    TEST(should be able to print 1781 feet as "1 MILE 21 YARD ")
    {
       ASSERT_EQ("1 MILE 21 YARD ", Length(1781, YARD).outputString());
    }
};

